package com.example.stock.service.impl;

import com.example.stock.excel.ExcelReaderUtil;
import com.example.stock.excel.StockDailyMonitor;
import com.example.stock.service.StockDailyMonitorService;
import com.example.stock.util.DataUtil;
import jakarta.annotation.PostConstruct;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
@Log4j2
public class StockDailyMonitorServiceImpl implements StockDailyMonitorService {

    private List<StockDailyMonitor> stockDailyMonitors;

    @PostConstruct
    private void init() {
        stockDailyMonitors = DataUtil.getListData(StockDailyMonitor.class, ExcelReaderUtil.FILE_OPERATION,"daily_monitor");
    }

    @Override
    public List<StockDailyMonitor> getStockDailyMonitors() {
        return stockDailyMonitors;
    }
}